public class test {
    //力扣283. 移动零  双指针
    public void moveZeroes(int[] nums) {
        int dest = -1;
        int cur = 0;
        while (cur < nums.length) {
            if (nums[cur] != 0) {
                int temp = nums[cur];
                nums[cur] = nums[++dest];
                nums[dest] = temp;
            }
            cur++;
        }
    }
}
